Skip to content

Enable clippy::use_self at workspace level and align codec implementations#79

Merged
nyurik merged 4 commits intomainfrom
copilot/enable-clippy-use-self
Mar 25, 2026
Merged

Enable clippy::use_self at workspace level and align codec implementations#79
nyurik merged 4 commits intomainfrom
copilot/enable-clippy-use-self

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

This change enables clippy::use_self in workspace lint configuration so the rule is enforced consistently. It also updates existing Rust codec code to conform to the newly enabled lint without changing behavior.

  • Workspace lint configuration

    • Added use_self = "warn" under [lints.clippy] in:
      • root Cargo.toml
      • fuzz/Cargo.toml (to keep fuzz crate lint settings aligned with workspace expectations)
  • Code updates required by use_self

    • Replaced explicit type repetitions with Self in constructors/default impls and associated method calls:
      • src/rust/integer_compression/fastpfor.rs
      • src/rust/integer_compression/just_copy.rs
      • src/rust/integer_compression/variable_byte.rs
  • Representative change

    impl VariableByte {
        #[must_use]
        pub fn new() -> Self {
            Self
        }
    }
    
    impl Default for VariableByte {
        fn default() -> Self {
            Self::new()
        }
    }

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
Agent-Logs-Url: https://github.com/fast-pack/FastPFOR-rs/sessions/3a614bfa-875a-4676-809a-0458acd944f8
Copilot AI changed the title [WIP] Enable clippy::use_self at workspace level Enable clippy::use_self at workspace level and align codec implementations Mar 25, 2026
Copilot AI requested a review from CommanderStorm March 25, 2026 04:31
@CommanderStorm CommanderStorm marked this pull request as ready for review March 25, 2026 04:41
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/rust/integer_compression/variable_byte.rs 50.00% 2 Missing ⚠️
src/rust/integer_compression/just_copy.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enables the clippy::use_self lint at the Cargo lint configuration level (root crate and fuzz crate) and updates a few Rust codec implementations to comply by using Self instead of repeating concrete type names.

Changes:

  • Enable use_self = "warn" under [lints.clippy] in Cargo.toml and fuzz/Cargo.toml.
  • Update VariableByte, JustCopy, and FastPFor implementations to use Self in constructors/defaults/associated calls to satisfy clippy::use_self.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Cargo.toml Enables clippy::use_self for the main crate’s lint configuration.
fuzz/Cargo.toml Enables clippy::use_self for the fuzz crate to keep lint settings aligned.
src/rust/integer_compression/fastpfor.rs Replaces FastPFor { ... } with Self { ... } in new() to satisfy the lint.
src/rust/integer_compression/just_copy.rs Uses Self / Self::new() in constructor and Default impl.
src/rust/integer_compression/variable_byte.rs Uses Self / Self::... in constructor, Default, and AnyLenCodec impl.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

nyurik and others added 2 commits March 25, 2026 00:44
Updated JustCopy struct to implement Default trait using default method.
@nyurik nyurik enabled auto-merge (squash) March 25, 2026 04:54
@nyurik nyurik merged commit 79e5d76 into main Mar 25, 2026
15 checks passed
@nyurik nyurik deleted the copilot/enable-clippy-use-self branch March 25, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants